  <div class="adminrectangle"><h2><?php echo $title;?></h2></div>

	<div class='clear'></div>
  <?php if(isset($message))
  {
  ?>
  <div id="infoMessage"><?php echo $message;?></div>
  <?php
  }
  ?>
      <?php if ($this->session->flashdata('message')) { ?>
      <div class="infoMessage"><?php echo $this->session->flashdata('message');?></div>
      <?php } ?>
      <?php
      if(isset($help_message_text))
      {
        if($help_message_text !="")
        {
      ?>
          <div id="helpMessage" title="<?php echo lang($help_message_title);?>"><?php echo lang($help_message_text);?></div>
      <?php
        }
      }
      ?>  

      <div class='clear'></div>
      <div class="grid_12 alpha omega">
        <div class="grid_4 alpha">
          <h5><?php echo lang('edit_team');?></h5>
          <?php echo form_open("admin/edit_team/".$team_number, "name='formname'");?>
      
            <div class='label'><?php echo lang('team_name');?>:</div>
            <div class='clear'></div>
            <div><?php echo form_input($team_name);?></div>
            <div class='clear'></div>

            <div class='label'><?php echo lang('team_shortname');?>:</div>
            <div class='clear'></div>
            <div><?php echo form_input($team_shortname);?></div>
            <div class='clear'></div>
            
            <div class='label'><?php echo lang('team_country');?>:</div>
            <div class='clear'></div>
            <div><?php echo form_input($team_country);?></div>
            <div class='clear'></div>

		      <div class='buttons'>
              <button type="submit" class="button positive"><span class="icon icon6"></span><span class='label'><?php echo lang('save');?></span></button>
      	  <?php echo anchor("admin/teams","<span class='icon icon7'></span><span class='label'>".lang('cancel')."</span>","class='button'");?>
            </div>
            <?php echo form_close();?>
        </div>
        <div class="grid_8 omega">
          <h5><?php echo lang('riders_under_contract');?></h5>
          <div class='help'><?php echo lang('edit_team_help');?></div>
          <?php echo form_open("admin/edit_team_save", "name='ridersform'");?>
          <table style="width:100%;">
            <th colspan='3'><?php echo lang('rider');?></th><th><?php echo lang('starter'); ?></th><th><?php echo lang('active'); ?></th>
            <?php
            foreach($riders as $rider)
            {
              $class='rider';
              if($rider->starter == 1)
              {
                $class .= ' starter';
              }
              if($rider->active == 1)
              {
                $class .= " active";
              } 
              elseif($rider->starter && !$rider->active)
              {
                $class .= " inactive";
              }
              else  
              {
                $class .= " redstriped";
              } 
            ?>
            <tr class="<?php echo $class;?>">
              <td><?php echo $rider->number;?></td>
              <td><?php echo anchor("admin/edit_rider/".$rider->rider_id."/?continue=".site_url('admin/edit_team/'.$team_number),$rider->last_name." ".$rider->first_name); ?></td>
              <td><?php echo lang($rider->type_description);?></td>
              <td style="text-align:center;">
                <?php
                $data = array(
                    'name'        => 'start_rider['.$rider->rider_id.']',
                    'id'          => 'start_rider',
                    'value'       => '1',
                    'checked'     => $rider->starter
                    );
                echo form_hidden('start_rider['.$rider->rider_id.']',0);
                echo form_checkbox($data);
                ?>
              </td>
              <td style="text-align:center;">
              <?php
                $data = array(
                    'name'        => 'active_rider['.$rider->rider_id.']',
                    'id'          => 'active_rider',
                    'value'       => '1',
                    'checked'     => $rider->active
                    );
                echo form_hidden('active_rider['.$rider->rider_id.']',0);
                echo form_checkbox($data);
                ?>
              </td>                
            </tr>
            <?php
            }
            ?>
          </table>

          <?php echo form_hidden('team_number',$team_number ); echo form_submit('submit', lang('save'));?>
        <?php echo form_close();?>  
        </div>        
      </div>
      <script src="<?php echo base_url();?>assets/js/jquery.ui.combobox.js"></script>
      <script>
      $(function() {
            $( ".combobox" ).combobox();
            });
      </script>      
